package com.hopes.bizz.poll.hj212.constant;

/**
 * Hj212协议相关常量
 */
public final class HJ212Constant {
    //时间格式
    public static final String DATE_FORMAT = "yyyyMMddHHmmss";
    //请求编码格式
    public static final String DATE_FORMAT_QN = "YYYYMMddHHmmssSSS";
    /**
     * 分隔符
     */
    public static final String SEPARATE = "\r\n";
    /**
     * key-MN号
     */
    public static final String KEY_MN = "mn";

    /**
     * key-CP
     */
    public static final String KEY_CP = "cp";

    /**
     * key-请求编码
     */
    public static final String KEY_REQUEST_NO = "qn";
    /**
     * key-系统编码
     */
    public static final String KEY_SYSTEM_NO = "st";
    /**
     * key-命令编码
     */
    public static final String KEY_COMMAND_NO = "cn";
    /**
     * key-密码
     */
    public static final String KEY_COMMAND_PW = "pw";
    /**
     * key-标志位，这个标志位包含标准版本号、是否拆分包、数据是否应答
     */
    public static final String KEY_FLAG = "flag";
    /**
     * key-数据时间
     */
    public static final String KEY_DATA_TIME = "time";
    /**
     * key-数据开始时间
     */
    public static final String KEY_DATA_BEGIN_TIME = "BeginTime";
    /**
     * key-数据结束时间
     */
    public static final String KEY_DATA_END_TIME = "EndTime";

    /**
     * 污染物实时数据
     */
    public static final String COMMAND_REAL_TIME_DATA = "2011";
    /**
     * 设备运行状态数据
     */
    public static final String COMMAND_RUN_STATUS_DATA = "2021";
    /**
     * 污染物日历史数据
     */
    public static final String COMMAND_DAY_DATA = "2031";
    /**
     * 污染物分钟数据
     */
    public static final String COMMAND_MINUTE_DATA = "2051";
    /**
     * 污染物小时数据
     */
    public static final String COMMAND_HOUR_DATA = "2061";
    /**
     * 启动清洗/反吹
     */
    public static final String COMMAND_STRAT_CLEARANCE_OR_BLOWBACK = "3013";

    /**
     * 因子数据key拆分的长度
     */
    public static final int FACTOR_KEY_SIZE = 2;

    /**
     * 因子索引
     */
    public static final int FACTOR_KEY_INDEX = 0;
    /**
     * 因子属性索引
     */
    public static final int FACTOR_ATTR_INDEX = 1;

    /**
     * 协议类型-HJ212-2017
     */
    public static final String PROTOCOL_TYPE_HJ212_2017 = "HJ212-2017";
    /**
     * 协议类型-HJ212-2005
     */
    public static final String PROTOCOL_TYPE_HJ212_2005 = "HJ212-2005";

    /**
     * 数据项属性
     */
    public static final String DATA_ITEM_ATTR_KEY = "key";

    /**
     * 数据项值
     */
    public static final String DATA_ITEM_ATTR_VALUE = "val";

    /**
     * 数据项值
     */
    public static final String DATA_ITEM_ATTR_ZS_VALUE = "zsval";

    /**
     * 实时数据
     */
    public static final String DATA_ITEM_ATTR_RTD = "Rtd";
    /**
     * 折算数据
     */
    public static final String DATA_ITEM_ATTR_ZS_RTD = "ZsRtd";
    /**
     * 均值
     */
    public static final String DATA_ITEM_ATTR_AVG = "Avg";
    /**
     * 折算均值
     */
    public static final String DATA_ITEM_ATTR_ZS_AVG = "ZsAvg";

    public static final String DATA_ITEM_ATTR_MAX = "Max";

    public static final String DATA_ITEM_ATTR_MIN = "Min";

    /**
     * 数据项类型：折算值
     */
    public static final String DATA_ITEM_ATTR_TYPE_ZS = "zs";
    /**
     * 小写 avg
     */
    public static final String LOWER_DATA_ITEM_ATTR_AVG = "avg";
    /**
     * 小写 zs avg
     */
    public static final String LOWER_DATA_ITEM_ATTR_ZS_AVG = "zsavg";
    /**
     * 小写 max
     */
    public static final String LOWER_DATA_ITEM_ATTR_MAX = "max";
    public static final String LOWER_DATA_ITEM_ATTR_MIN = "min";
    public static final String LOWER_DATA_ITEM_ATTR_COU = "cou";

    /**
     * 属性转换 rtd,avg ==> val
     */
//    public static final String DATA_ATTR_TO_VAL = "rtd,avg";


}
